package com.thirdgroup.service.impl;

import com.thirdgroup.dao.NoticeDao;
import com.thirdgroup.dao.impl.NoticeDaoImpl;
import com.thirdgroup.pojo.entity.SysNotice;
import com.thirdgroup.service.NoticeService;
import com.thirdgroup.utils.respond.R;

import java.util.List;

public class NoticeServiceImpl implements NoticeService {
    private NoticeDao noticeDao=new NoticeDaoImpl();
    @Override
    public R selectAll() {
        List<SysNotice> sysNotices = noticeDao.selectAll();
        if (sysNotices!=null&&!"".equals(sysNotices)){
           return R.ok(sysNotices);
        }
        System.out.println("系统繁忙，请稍后再试~");
        return R.error(500,"系统繁忙，请稍后再试~");
    }

}
